package p270jp.pxv.android.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.databinding.DataBindingUtil;
import p014ae.AbstractActivityC0187y1;
import p014ae.C0135p4;
import p014ae.C0185y;
import p071cd.Functions;
import p134ei.AnalyticsScreenName;
import p165fo.C3114c;
import p187gl.PixivRequest;
import p270jp.pxv.android.R;
import p270jp.pxv.android.legacy.event.ShowNovelDetailDialogEvent;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p307l9.EdgeTreatment;
import p314lg.ActivityNovelDetailBinding;
import p370ni.InfoType;
import p645yc.AndroidSchedulers;
import p671zc.CompositeDisposable;

/* renamed from: jp.pxv.android.activity.NovelDetailActivity */
/* loaded from: classes2.dex */
public class NovelDetailActivity extends AbstractActivityC0187y1 {

    /* renamed from: d0 */
    public static final /* synthetic */ int f18435d0;

    /* renamed from: b0 */
    public CompositeDisposable f18436b0 = new CompositeDisposable();

    /* renamed from: c0 */
    public ActivityNovelDetailBinding f18437c0;

    /* renamed from: e1 */
    public static Intent m4804e1(Context context, long j) {
        EdgeTreatment.m3910h(j > 0);
        Intent intent = new Intent(context, NovelDetailActivity.class);
        intent.putExtra("NOVEL_ID", j);
        return intent;
    }

    /* renamed from: f1 */
    public final void m4803f1() {
        long longExtra = getIntent().getLongExtra("NOVEL_ID", -1);
        this.f18437c0.f21555s.m4595d(InfoType.LOADING, null);
        this.f18436b0.mo82c(PixivRequest.m5812e(longExtra).m986o(AndroidSchedulers.m334a()).m984q(new C0185y(this, 3), new C0135p4(this, 3), Functions.f5386c, Functions.f5387d));
    }

    @Override // p270jp.pxv.android.activity.AbstractActivityC4151b, p270jp.pxv.android.activity.BaseActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, p248j2.ActivityC3902g, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        this.f18437c0 = (ActivityNovelDetailBinding) DataBindingUtil.m11369d(this, R.layout.activity_novel_detail);
        this.f18757A.m6525e(AnalyticsScreenName.NOVEL_DETAIL_DEEP_LINK);
        if (getIntent().hasExtra("NOVEL")) {
            C3114c.m6284b().m6280f(new ShowNovelDetailDialogEvent((PixivNovel) getIntent().getSerializableExtra("NOVEL")));
        } else {
            m4803f1();
        }
    }

    @Override // p014ae.AdActivity, p270jp.pxv.android.activity.BaseActivity, p116e.ActivityC2727f, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        this.f18436b0.m80f();
        super.onDestroy();
    }
}
